#include "ros/ros.h"

#include "std_msgs/String.h"
#include <geometry_msgs/Twist.h>
#include <signal.h>
#include <termios.h>
#include <stdio.h>
#include "boost/thread/mutex.hpp"
#include "boost/thread/thread.hpp"
#include <math.h>
#include <driver/Move.h>
#include <sensor_msgs/Joy.h>

#define KEYCODE_R 0x43 
#define KEYCODE_L 0x44
#define KEYCODE_U 0x41
#define KEYCODE_D 0x42
#define KEYCODE_Q 0x71


/**
 *	Input class.
 **/
class Input
{
 
  
public:
					Input 				();
	void 			joystick_callback	(const sensor_msgs::Joy::ConstPtr& joy);
	void 			keyboard_watchdog 	();
	void 			keyboard_loop 		();
	static void 	quit 				(int sig);
private:
	ros::Publisher 	move_publisher;
	ros::Subscriber	joy_subscriber;
	void 			publish 			(double distance, double angle);
	ros::NodeHandle n,p;
	double 			angle;
	
	ros::Time 		last_publish_;
	double 			l_scale_, a_scale_;
	boost::mutex 	publish_mutex_;

};
